<template>
  <el-dialog
    width="340px"
    v-model="state.TimeDialog.show"
    title="仓库确认发货时间"
    class="dialog"
  >
    <div class="dialogContent">
      <el-form
        :model="state.TimeDialog.query"
        label-suffix="："
        label-width="100px"
        label-position="left"
      >
        <el-form-item label="货号时间确认">
          <el-date-picker
            v-model="state.TimeDialog.query.date"
            type="datetime"
            placeholder="请选择"
            format="YYYY-MM-DD HH"
            date-format="YYYY-MM-DD HH"
            time-format="HH:mm"
          />
        </el-form-item>
      </el-form>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="state.TimeDialog.show = false">取消</el-button>
        <el-button type="primary" @click="TimeSubmit"> 确定 </el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
import { ref, onMounted, reactive, nextTick, defineExpose } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";

const state = reactive({
  TimeDialog: {
    show: false,
    query: {
      date: "",
    },
  },
});

const openDialog = () => {
  state.TimeDialog.show = true;
};

const TimeSubmit = () => {
  if(!state.TimeDialog.query.date){
    ElMessage.warning("请选择确认时间");
    return;
  }
  ElMessage.success("成功");
  state.TimeDialog.show = false;
};
defineExpose({ openDialog });
</script>
<style lang="scss" scoped>
.MoreDialogContent {
  padding: 8px;
}

.MoreDialogText {
  color: rgba(60, 65, 68, 1);
  font-size: 12px;
  line-height: 20px;
  letter-spacing: 0px;
  text-align: left;
}
</style>
